package com.hua.springCloud.controller;

import com.hua.springCloud.Service.impl.OrderServiceImpl;
import com.hua.springCloud.entities.CommonResult;
import com.hua.springCloud.entities.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class Controller {
    @Autowired
    private OrderServiceImpl orderService;
    @RequestMapping("/create/order")
    public CommonResult createOrder(Order order){
        orderService.create(order);
        return new CommonResult(200,"插入成功",order);
    }

    @GetMapping("/getInfo")
    public String getInfo1(){
        return "1";
    }

}
